﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.ServiceProcess;
using System.Text;

namespace SerialPort2Socket
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        static void Main()
        {
            string configFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.ini");
            var lines = File.ReadAllLines(configFile, Encoding.Default);
            foreach (var item in lines)
            {
                if (!string.IsNullOrEmpty(item))
                    new SocketServer(item).Open();
            }

            //Console.ReadLine();
            ServiceBase[] ServicesToRun;
            ServicesToRun = new ServiceBase[]
            {
                new Service1()
            };
            ServiceBase.Run(ServicesToRun);
        }
    }
}
